const app = getApp()
Page({
    data: {
        avatar:'',
    },
    onShow: function(t){
      if(wx.getStorageSync('role') !== 1){
        wx.switchTab({
          url: '../index/index'
        })
        return;
      }
      this.setData({
          avatar:wx.getStorageSync('avatarUrl')
      })
    },
    gopersonal:function(){
      wx.navigateTo({
        url: "/pages/login/personal" 
      });
    },
    gomechanism:function(){
      wx.navigateTo({
        url: "/pages/login/company" 
      });
    },
    onShareAppMessage: function() {
      return {
          title: "天意美业直通车",
          path: "/pages/index/index?puid="+wx.getStorageSync('uid')
      };
    }
});